#-*-coding:utf8 -*-
import base64

from django import template
from django.template.defaultfilters import stringfilter
register = template.Library()
import logging

@register.filter(name='encode')
@stringfilter
def encode(value):
    #logging.debug("ORIGINAL = " + value)
    #logging.debug(base64.encodestring(value))
    #logging.debug(enc[:-1])

    enc = base64.encodestring(value)

    '''개행문자가 왜 추가되는걸까...'''
    return enc[:-1]


#register.filter('foo', foo)
